<!-- 自定义顶部导航【带返回】 -->
<template>
	<view class="top_nav_return">
		<view class="top_nav_title">
			<view class="imgbox" v-if="returnState == true">
				<image src="../../../static/icon/arrow_l.png" mode=""></image>
				<view class="returnbox" @click="backPage()"></view>
			</view>
			<view class="">
				{{topNavTitle}}
			</view>
			<view class="">
				<!-- 占位，不要删除 -->
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		//	topNavTitle	导航标题
		props: ['topNavTitle', 'returnState', 'router'],
		methods: {
			backPage() {
				console.log(this.router)
				if (this.router) {
					uni.reLaunch({
						url: '/' + this.router
					})
				} else {
					console.log(123)
					uni.navigateBack()
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.returnbox {
		position: absolute;
		top: -15rpx;
		left: -15rpx;
		height: 60rpx;
		width: 70rpx;
		// border:1px red solid;
	}

	.top_nav_return {
		position: fixed;
		z-index: 10;
		top: 0;
		left: 0;
		width: 100vw;
		padding-top: 90rpx;
		padding-bottom: 30rpx;
		background-color: #fff;

	}

	.top_nav_title {
		position: relative;
		text-align: center;
		font-size: 36rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #132B2E;
		padding: 0 30rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.imgbox {
		position: relative;
		// z-index: 10;
		// top: 0;
		// left: 30rpx;
		// height: 36rpx;
		// display: flex;
		// justify-content: start;

		image {
			height: 36rpx;
			width: 19rpx;
		}
	}
</style>
